package icegps.com.bhmap.evaluator;

import android.animation.TypeEvaluator;

import icegps.com.bhmap.bean.MultipleEvaluatorHelp;

/**
 * Created by 111 on 2017/12/9.
 */

public class MultipleEvaluator implements TypeEvaluator<MultipleEvaluatorHelp> {
    @Override
    public MultipleEvaluatorHelp evaluate(float fraction, MultipleEvaluatorHelp startValue, MultipleEvaluatorHelp endValue) {

        float multiple = startValue.getMultiple() + fraction * (endValue.getMultiple() - startValue.getMultiple());

        float px = startValue.getPx() + fraction * (endValue.getPx() - startValue.getPx());

        float py = startValue.getPy() + fraction * (endValue.getPy() - startValue.getPy());

        MultipleEvaluatorHelp multipleEvaluatorHelp = new MultipleEvaluatorHelp();

        multipleEvaluatorHelp.setMultiple(multiple);

        multipleEvaluatorHelp.setPx(px);

        multipleEvaluatorHelp.setPy(py);

        return multipleEvaluatorHelp;
    }
}
